<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'HomeController@index');


//后台登录的视图和接口
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function (){
    //后台登录接口
    Route::get('/', 'EntryController@index');
    Route::post('/login','EntryController@login');
    Route::get('/logout','EntryController@logout');
    //验证用户是否进行登录 使用中间件
    Route::group(['middleware'=>['admin_c.auth:admin']],function(){
        Route::post('/add_tag','TagController@addTag');
        Route::get('/first_level','TagController@get_first_level');
        Route::get('/get_tags','TagController@get_all_list');
        Route::get('/remove_tag','TagController@remove_tag');
        Route::post('/edit_tag','TagController@edit_tag');
        Route::get('/get_tag','TagController@get_tag');
        Route::any('/upload','UploadController@upload');

        Route::any('/oss_upload','UploadController@oss_upload');
        Route::any('/cancel_img','UploadController@cancel_img');
        Route::any('/get_test','UploadController@get_test');


        Route::post('/add_article','ArticleController@add_article');
        Route::get('/get_article','ArticleController@get_article');
        Route::get('/get_specific_article','ArticleController@get_specific_article');
        Route::post('/edit_article','ArticleController@update_article');
        Route::get('/cancel_article','ArticleController@cancel_article');
        Route::get('/cancel_completely_article','ArticleController@cancel_completely_article');
        Route::get('/set_recommend','ArticleController@set_recommend');
        Route::get('/set_top','ArticleController@set_top');
    });
    Route::get('/{query}', 'EntryController@index')->where('query','.*');

});






